package com.ITArmy.service;

import com.ITArmy.beans.Blog;
import com.ITArmy.beans.Shows.CommentMessage;
import com.ITArmy.beans.Shows.ReadBlog;
import com.ITArmy.beans.Shows.ReplyMessage;
import com.ITArmy.common.ServerResponse;
import com.sun.org.apache.xpath.internal.operations.Mod;
import org.springframework.ui.Model;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface BlogService {
    /**
     * 添加博客
     *
     * @param blog blog
     * @return ServerResponse
     */
    ServerResponse addBlogByBack(Blog blog);

    /**
     * 删除博客
     *
     * @param id id
     * @return ServerResponse
     */
    ServerResponse deleteBlogById(Long id);

    /**
     * 批量删除
     *
     * @param ids ids
     * @return ServerResponse
     */
    ServerResponse deleteManyBlogByIds(String[] ids);

    /**
     * 遍历博客
     *
     * @return List<Blog>
     */
    List<Blog> findAllBlog();

    /**
     * 修改博客
     *
     * @param blog blog
     * @return ServerResponse
     */
    ServerResponse updateBlog(Blog blog);

    /**
     * 根据博客标题模糊搜索
     *
     * @param title title
     * @return ServerResponse
     */
    ServerResponse findBlogByTitle(String title);

    /**
     * 根据博客类型搜索
     *
     * @param tid tid
     * @return ServerResponse
     */
    List<ReadBlog> findBlogByType(Integer tid);


    /**
     * 设置为推荐
     *
     * @param id id
     * @return ServerResponse
     */
    ServerResponse recommend(Long id);

    /**
     * 取消推荐
     *
     * @param id id
     * @return ServerResponse
     */
    ServerResponse unrecommend(Long id);

    /**
     * 遍历推荐博客
     *
     * @return ServerResponse
     */
    ServerResponse recommendList();

    /**
     * 根据博客类型遍历推荐博客
     *
     * @param tid tid
     * @return ServerResponse
     */
    ServerResponse findRecommendByType(Integer tid);

    /**
     * 显示用户喜欢的博客
     *
     * @param request request
     * @return ServerResponse
     */
    List<ReadBlog> findLikeBlog(HttpServletRequest request);

    /**
     * 根据id显示用户发表所有的博客
     *
     * @param request request
     * @return ServerResponse
     */
    ServerResponse getPublishCount(HttpServletRequest request);

    /**
     * 发表博客
     *
     * @param request request
     * @param blog    blog
     * @return ServerResponse
     */
    ServerResponse addBlog(HttpServletRequest request, Blog blog);

    /**
     * 获取关于博客的全部信息
     */
    public List<CommentMessage> getBlogCommentMessage(long blogId);

    /**
     * 通过类型id查找博客
     *
     * @param tid tid
     * @return ServerResponse
     */
    ServerResponse findByType(Integer tid);

    ReadBlog findBlogById(Long bid, HttpServletRequest request);

    List<ReplyMessage> getReplyMessageByCid(long cId);

    List<ReadBlog> getAllReadBlogs(HttpServletRequest request);

    /**
     * 显示用户发表过的所有的博客的信息
     */
    List<ReadBlog> getPersonPublicBlog(long uId);
}
